import {REMOVE_TOKE, SET_ROLE, SET_TOKE} from '@/store/mutations-types'
import Cookie from "js-cookie"
/**
 * @author 太阳当空丶赵
 * @date 2022/11/14-21:35
 * @version 1.0.0
 * commit
 */
export default {
    [SET_TOKE](state, token){
        localStorage.setItem("token",token)
        Cookie.set("token",token)
        state.token = token
    },
    [REMOVE_TOKE](state){
        localStorage.clear()
        state.token = null
    },
    [SET_ROLE](state,role){
        localStorage.setItem("nowRole",role)
        state.nowRole = role

    }
}
